
CC=gcc
time_info=$(shell date +%Y%m%d )
svn_info=$(shell svn info|grep Revision|awk -F' ' '{ print $$2 }' )
SRC = main.c version.c 

TARGET = out.elf   

OBJ := $(SRC:.c=.o)


all:version.h $(OBJ)
	$(CC) -DDEBUG -Wall -g -o $(TARGET) $(OBJ)

%.o:%.c
	$(CC) -DDEBUG -Wall -g -o $@ -c $<

version.h:
	@echo "#define VERSION \"VERSOIN_REL_SVN$(svn_info)_BUILD_$(time_info)\"" >version.h


.PHONY:clean

clean:
	-rm -f $(OBJ) $(TARGET) version.h
